<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Post extends Model
{
    protected $fillable = ['author_id','category_id','seo_title','title','body','image','slug','description','keywords'];
    public function category() {
        return $this->belongsTo(Category::class);
    }

    public function replies() {
        return $this->hasMany(Reply::class,'post_id','id');
    }
    public function user() {
        return $this->belongsTo(User::class,'author_id','id');
    }
}
